package com.zhq.zhq_blog.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.time.LocalDateTime;

import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.annotations.ApiModel;

/**
 * <p>
 * 
 * </p>
 */
@TableName("tb_blog")
@ApiModel(value = "Blog对象", description = "")
@JsonInclude(JsonInclude.Include.NON_NULL)	//注解控制null不序列化.因为Android端如果使用kotlin不可空类型的话，会出现类型错误
public class Blog implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    private String title;

    private String content;

    private LocalDateTime updateTime;

    private LocalDateTime createTime;

    private Integer userId;

    @TableField(exist = false)
    public User user;
    @TableField(exist = false)
    public Integer collectCount;
    @TableField(exist = false)
    public Integer isMyCollected;
    @TableField(exist = false)
    public Integer praiseCount;
    @TableField(exist = false)
    public Integer isMyPraised;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }
    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }
    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }
    public LocalDateTime getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(LocalDateTime updateTime) {
        this.updateTime = updateTime;
    }
    public LocalDateTime getCreateTime() {
        return createTime;
    }

    public void setCreateTime(LocalDateTime createTime) {
        this.createTime = createTime;
    }
    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }


    @Override
    public String toString() {
        return "Blog{" +
                "id=" + id +
                ", title='" + title + '\'' +
                ", content='" + content + '\'' +
                ", updateTime=" + updateTime +
                ", createTime=" + createTime +
                ", userId=" + userId +
                ", user=" + user +
                ", collectCount=" + collectCount +
                ", isMyCollected=" + isMyCollected +
                ", praiseCount=" + praiseCount +
                ", isMyPraised=" + isMyPraised +
                '}';
    }
}
